package com.sky.sqlSession;

import com.sky.executor.Executor;
import com.sky.executor.SimpleExecutor;
import com.sky.pojo.Configuration;

/**
 * @Description sqlSessionFactory实现类
 * @Author gaotianzhi
 * @Date 2023-10-31 16:38
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }


    @Override
    public SqlSession openSession() {
        Executor executor = new SimpleExecutor();
        SqlSession sqlSession = new DefaultSqlSession(executor, configuration);
        return sqlSession;
    }


}
